<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>R - GAC</title>
            </f:facet>
        </h:head>

        <h:body>

            <p:layout fullPage="true">

                <p:layoutUnit position="north" size="80" resizable="true" closable="true" collapsible="true">
                    REPOSITORIO PARA LA GESTIÓN DE ACTIVOS BASADA EN CARACTERÍSTICAS EN EL MARCO DEL PROCESO SMALL SPL
                </p:layoutUnit>

                <p:layoutUnit position="south" size="50" closable="true" collapsible="true">
                    DIEGO JAVIER GARCÍA  -  JARVY GÓMEZ
                </p:layoutUnit>

                <p:layoutUnit position="west" size="375" header="" collapsible="true">

                    <p:tabView id="tabView">

                        <p:tab id="tab1" title="LINEA DE PRODUCTOS">




                            <h:form id="form">



                                <p:tree 

                                    selectionMode="checkbox"
                                    dynamic="true"
                                    value="#{treeBeanLP.root}" 
                                    var="node" 
                                    selection="#{treeBeanLP.selectedNodes}">


                                    <p:treeNode>
                                        <h:outputText value="#{node}" />
                                    </p:treeNode>
                                </p:tree>




                            </h:form> 


                        </p:tab>



                    </p:tabView>                    




                </p:layoutUnit>

                <p:layoutUnit position="center">

                    <p:tabView id="tabView2">

                        <p:tab id="tab1" title="MI MODELO">

                            <h:form id="form1">
                                <p:panel id="panel1" header="Nuevo Modelo Diseñado">
                                    <p:growl id="growl1" showSummary="true" showDetail="true" autoUpdate="true"/>

                                    <p:tree id="tree1" value="#{treeBean.model}"
                                            var="node"
                                            selectionMode="single"
                                            selection="#{treeBean.selectedNode}"
                                            >
                                        <p:ajax event="select"  listener="#{treeBean.onNodeSelect}" />
                                        <p:ajax event="expand" listener="#{treeBean.onNodeExpand}" />
                                        <p:ajax event="collapse" listener="#{treeBean.onNodeCollapse}" />
                                        <p:treeNode type="node"
                                                    expandedIcon="folder-open"
                                                    collapsedIcon="folder-collapsed">
                                            <h:outputText value="#{node}"/>
                                        </p:treeNode>
                                        <p:treeNode type="leaf" icon="document-node">
                                            <h:outputText value="#{node}" />
                                        </p:treeNode>
                                    </p:tree>
                                </p:panel>
                            </h:form>


                        </p:tab>
                        <p:tab id="tab2" title="GESTOR DE ACTIVOS">
                            <h:panelGrid columns="2" cellpadding="10">


                                <p:tabView orientation="left">
                                    <p:tab title="ADICIONAR">
                                        <h:panelGrid columns="2" cellpadding="10">



                                            <h:form>
                                                <h:panelGrid columns="2">
                                                    <h:outputLabel value="#{bundle.CreateAssetLabel_id}" for="id" />
                                                    <h:inputText id="id" value="#{assetController.selected.id}" title="#{bundle.CreateAssetTitle_id}" required="true" requiredMessage="#{bundle.CreateAssetRequiredMessage_id}"/>

                                                    <h:outputLabel value="#{bundle.CreateAssetLabel_name}" for="name" />
                                                    <h:inputText id="name" value="#{assetController.selected.name}" title="#{bundle.CreateAssetTitle_name}" required="true" requiredMessage="#{bundle.CreateAssetRequiredMessage_name}"/>

                                                    <h:outputLabel value="#{bundle.CreateAssetLabel_idFeature}" for="idFeature" />
                                                    <h:inputText id="idFeature" value="#{assetController.selected.idFeature}" title="#{bundle.CreateAssetTitle_idFeature}" required="true" requiredMessage="#{bundle.CreateAssetRequiredMessage_idFeature}"/>

                                                    <h:outputLabel value="#{bundle.CreateAssetLabel_type}" for="type" />
                                                    <h:inputText id="type" value="#{assetController.selected.type}" title="#{bundle.CreateAssetTitle_type}" required="true" requiredMessage="#{bundle.CreateAssetRequiredMessage_type}"/>
                                                </h:panelGrid>
                                                <br />
                                                <h:form enctype="multipart/form-data">

                                                    <p:messages showDetail="true"/>

                                                    <p:fileUpload value="#{fileUploadController.file}" mode="simple"/>



                                                </h:form>
                                                <br />
                                                <h:commandLink action="#{assetController.create}" value="#{bundle.CreateAssetSaveLink}" />
                                                <br />
                                                <br />



                                            </h:form>




                                        </h:panelGrid>
                                    </p:tab>
                                    <p:tab title="ELIMINAR">
                                        <h:panelGrid columns="2" cellpadding="10">

                                            <h:form>

                                                <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">



                                                    <h:outputLabel value="#{bundle.CreateAssetLabel_name}" for="name" />
                                                    <h:inputText id="name" value="#{assetController.selected.name}" title="#{bundle.CreateAssetTitle_name}" required="true" requiredMessage="#{bundle.CreateAssetRequiredMessage_name}"/>


                                                    <h:outputText value="LINEA DE PRODUCTO: " />
                                                    <p:selectOneMenu value="#{buttonBean.number1}">
                                                        <f:selectItem itemLabel="Seleccione Uno" itemValue="" />
                                                        <f:selectItem itemLabel="LP 1" itemValue="1" />
                                                        <f:selectItem itemLabel="LP 2" itemValue="2" />
                                                        <f:selectItem itemLabel="LP 3" itemValue="3" />
                                                    </p:selectOneMenu>

                                                    <h:outputText value="TIPO DE ACTIVO: " />
                                                    <p:selectOneMenu value="#{buttonBean.number2}">
                                                        <f:selectItem itemLabel="Seleccione Uno" itemValue="" />
                                                        <f:selectItem itemLabel="ANALISIS" itemValue="1" />
                                                        <f:selectItem itemLabel="DISEÑO" itemValue="2" />
                                                        <f:selectItem itemLabel="IMPLEMENTACIÓN" itemValue="3" />
                                                    </p:selectOneMenu>


                                                    <h:outputText value="CARACTERISTICA: " />
                                                    <p:selectOneMenu value="#{buttonBean.number3}">
                                                        <f:selectItem itemLabel="Seleccione Uno" itemValue="" />
                                                        <f:selectItem itemLabel="CARACTERISTICA 1" itemValue="1" />
                                                        <f:selectItem itemLabel="CARACTERISTICA 2" itemValue="2" />
                                                        <f:selectItem itemLabel="CARACTERISTICA 3" itemValue="3" />
                                                    </p:selectOneMenu>


                                                </h:panelGrid>

                                                <p:commandButton value="ELIMINAR" update="display" oncomplete="PF('dlg').show()" action="#{assetController.create}" />

                                                <p:dialog header="Selected Values" modal="true" showEffect="fade" hideEffect="fade" widgetVar="dlg">
                                                    <h:panelGrid columns="1" id="display">


                                                        <h:outputText value="#{buttonBean.number1}" />

                                                        <h:outputText value="#{buttonBean.number2}" />

                                                        <h:outputText value="#{buttonBean.number3}" />



                                                    </h:panelGrid>
                                                </p:dialog>



                                            </h:form>




                                        </h:panelGrid>
                                    </p:tab>
                                    <p:tab title="MODIFICAR">
                                        <h:panelGrid columns="2" cellpadding="10">


                                            <h:form styleClass="jsfcrud_list_form">
                                                <h:panelGroup id="messagePanel" layout="block">
                                                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                                                </h:panelGroup>
                                                <h:outputText escape="false" value="#{bundle.ListAssetEmpty}" rendered="#{assetController.items.rowCount == 0}"/>
                                                <h:panelGroup rendered="#{assetController.items.rowCount > 0}">
                                                    <h:outputText value="#{assetController.pagination.pageFirstItem + 1}..#{assetController.pagination.pageLastItem + 1}/#{assetController.pagination.itemsCount}"/>&nbsp;
                                                    <h:commandLink action="#{assetController.previous}" value="#{bundle.Previous} #{assetController.pagination.pageSize}" rendered="#{assetController.pagination.hasPreviousPage}"/>&nbsp;
                                                    <h:commandLink action="#{assetController.next}" value="#{bundle.Next} #{assetController.pagination.pageSize}" rendered="#{assetController.pagination.hasNextPage}"/>&nbsp;
                                                    <h:dataTable value="#{assetController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                                                        <h:column>
                                                            <f:facet name="header">
                                                                <h:outputText value="#{bundle.ListAssetTitle_id}"/>
                                                            </f:facet>
                                                            <h:outputText value="#{item.id}"/>
                                                        </h:column>
                                                        <h:column>
                                                            <f:facet name="header">
                                                                <h:outputText value="#{bundle.ListAssetTitle_name}"/>
                                                            </f:facet>
                                                            <h:outputText value="#{item.name}"/>
                                                        </h:column>
                                                        <h:column>
                                                            <f:facet name="header">
                                                                <h:outputText value="#{bundle.ListAssetTitle_idFeature}"/>
                                                            </f:facet>
                                                            <h:outputText value="#{item.idFeature}"/>
                                                        </h:column>
                                                        <h:column>
                                                            <f:facet name="header">
                                                                <h:outputText value="#{bundle.ListAssetTitle_type}"/>
                                                            </f:facet>
                                                            <h:outputText value="#{item.type}"/>
                                                        </h:column>
                                                        <h:column>
                                                            <f:facet name="header">
                                                                <h:outputText value="&nbsp;"/>
                                                            </f:facet>
                                                            <h:commandLink action="#{assetController.prepareView}" value="#{bundle.ListAssetViewLink}"/>
                                                            <h:outputText value=" "/>
                                                            <h:commandLink action="#{assetController.prepareEdit}" value="#{bundle.ListAssetEditLink}"/>
                                                            <h:outputText value=" "/>
                                                            <h:commandLink action="#{assetController.destroy}" value="#{bundle.ListAssetDestroyLink}"/>
                                                        </h:column>
                                                    </h:dataTable>
                                                </h:panelGroup>
                                                <br />
                                                <h:commandLink action="#{assetController.prepareCreate}" value="#{bundle.ListAssetCreateLink}"/>
                                                <br />
                                                <br />
                                                <h:link outcome="/index" value="#{bundle.ListAssetIndexLink}"/>
                                            </h:form>





                                        </h:panelGrid>
                                    </p:tab>
                                    <p:tab title="BUSCAR">
                                        <h:panelGrid columns="2" cellpadding="10">


                                            <h:form>

                                                <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">

                                                    <h:outputText value="NOMBRE: " />
                                                    <p:inputText />


                                                    <h:outputText value="LINEA DE PRODUCTO: " />
                                                    <p:selectOneMenu value="#{buttonBean.number1}">
                                                        <f:selectItem itemLabel="Seleccione Uno" itemValue="" />
                                                        <f:selectItem itemLabel="LP 1" itemValue="1" />
                                                        <f:selectItem itemLabel="LP 2" itemValue="2" />
                                                        <f:selectItem itemLabel="LP 3" itemValue="3" />
                                                    </p:selectOneMenu>

                                                    <h:outputText value="TIPO DE ACTIVO: " />
                                                    <p:selectOneMenu value="#{buttonBean.number2}">
                                                        <f:selectItem itemLabel="Seleccione Uno" itemValue="" />
                                                        <f:selectItem itemLabel="ANALISIS" itemValue="1" />
                                                        <f:selectItem itemLabel="DISEÑO" itemValue="2" />
                                                        <f:selectItem itemLabel="IMPLEMENTACIÓN" itemValue="3" />
                                                    </p:selectOneMenu>


                                                    <h:outputText value="CARACTERISTICA: " />
                                                    <p:selectOneMenu value="#{buttonBean.number3}">
                                                        <f:selectItem itemLabel="Seleccione Uno" itemValue="" />
                                                        <f:selectItem itemLabel="CARACTERISTICA 1" itemValue="1" />
                                                        <f:selectItem itemLabel="CARACTERISTICA 2" itemValue="2" />
                                                        <f:selectItem itemLabel="CARACTERISTICA 3" itemValue="3" />
                                                    </p:selectOneMenu>


                                                </h:panelGrid>

                                                <p:commandButton value="BUSCAR" update="display" oncomplete="PF('dlg').show()" />

                                                <p:dialog header="Selected Values" modal="true" showEffect="fade" hideEffect="fade" widgetVar="dlg">
                                                    <h:panelGrid columns="1" id="display">
                                                        <h:outputText value="Value 1: #{buttonBean.number1}" />
                                                        <h:outputText value="Value 1: #{buttonBean.number2}" />
                                                        <h:outputText value="Value 1: #{buttonBean.number3}" />



                                                    </h:panelGrid>
                                                </p:dialog>

                                            </h:form>






                                        </h:panelGrid>
                                    </p:tab>

                                </p:tabView>



                            </h:panelGrid>
                        </p:tab>





                    </p:tabView>




                </p:layoutUnit>

            </p:layout>

        </h:body>

    </f:view>
</html>

